import pymysql
import pandas as pd
from datetime import datetime
from db_conn.dbConn import conn_db,conn_db_engine
import pandas as pd
import time
from sqlalchemy import create_engine
from db_conn.dbConn import conn_db_engine
conn1 = conn_db_engine('iot_local')
conn2 = conn_db_engine('ryerp_local')
connect = conn_db('ryerp_local')

previous_time_point = datetime.now() - pd.Timedelta(days = 3)
sql1 = 'SELECT * FROM iotdemo WHERE receive_time <= %s'
df_iot = pd.read_sql(sql1,con=conn1,params=(previous_time_point,))
#找出df_iot中最小的id和最大的id
min_id = df_iot['id'].min()
max_id = df_iot['id'].max()
#找出


